package com.g_prj.Service;

import com.g_prj.dao.StaffsMapper;
import com.g_prj.domain.Staffs;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StaffsService {
    @Resource
    StaffsMapper staffsMapper;
    public boolean insert(Staffs staffs){
        if (staffsMapper.insert(staffs)>0){
            return true;
        }
        return false;
    }
    public boolean delete(int id){
        if (staffsMapper.deleteByPrimaryKey(id)>0){
            return true;
        }
        return false;
    }
    public boolean update(Staffs staffs){
        if (staffsMapper.updateByPrimaryKey(staffs)>0){
            return true;
        }
        return false;
    }
    public Staffs selectById(int id){
        return staffsMapper.selectByPrimaryKey(id);

    }
    public List<Staffs> selectAll(){
        return staffsMapper.selectAll();

    }

}
